#include "SelectionManager.h"
#include <QtCore/qglobal.h>


SelectionManager::SelectionManager(SceneManager* pSceneManager):
m_SelectionBoxManager(pSceneManager)
{
	Q_ASSERT(pSceneManager);
}


void SelectionManager::add(osg::Node* pNode)
{
	m_SelectionSet.add(pNode);
	m_SelectionBoxManager.add(pNode);
}


void SelectionManager::remove(osg::Node* pNode)
{
	m_SelectionSet.remove(pNode);
	m_SelectionBoxManager.remove(pNode);
}


bool SelectionManager::isSelected(osg::Node *pNode) const
{
	return m_SelectionSet.containsNode(pNode);
}


osg::Node* SelectionManager::getFirstSelected() const
{
	return m_SelectionSet.getFirstNode();
}

